package month_03.day22;

import lombok.extern.slf4j.Slf4j;

@Slf4j
public class Demo09 {
    public static volatile  boolean flag=true;
    public static class T1 extends Thread{
        public T1(String name){
            super(name);
        }

        @Override
        public void run() {
            log.info("线程" + this.getName() + " in");
            while (flag) {
                ;
            }
            log.info("线程" + this.getName() + "停止了");
        }
    }

    public static void main(String[] args) throws InterruptedException {
        new T1("t1").start();
        Thread.sleep(1000);
        flag=false;
    }
}
